<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .file {
            width: 100px;
            height: 40px;
            position: relative;

            overflow: hidden;
        }

        input {
            /* width: 100px;
            height: 40px; */

            width: 0;
            padding: 0;
            padding: 50px;

            overflow: hidden;
            background-color: #ff0;
            position: absolute;
            left: 0;
            cursor: pointer;

            /* 减少按钮的范围 */
            /* font-size: 0; */
            opacity: 0;
        }

        div {
            width: 100px;
            height: 40px;
            background-color: #00f;
            color: #fff;
            text-align: center;
            line-height: 40px;
        }
    </style>
</head>

<body>
    <div class="file">
        <input type="file">
        <div>点击上传</div>
    </div>
</body>

</html>